package com.briup.day3;

import java.util.Scanner;

public class Test2 {
    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        // 注意 hasNext 和 hasNextLine 的区别
        while (in.hasNextLine()) { // 注意 while 处理多个 case
            String password = in.nextLine();
            int sum1 = getLen(password);
            int sum2 = getChar(password);
            int sum3 = getNum(password);
            int sum4 = getSym(password);
            int score = sum1 + sum2 + sum3 + sum4;
            if(sum2 == 20 && sum3 != 0 && sum4 != 0) {
                score += 5;
            }else if(sum2 == 10 && sum3 != 0 && sum4 != 0) {
                score += 3;
            }else if(sum2 != 0 && sum3 != 0) {
                score += 2;
            }

            if(score >= 90) {
                System.out.println("VERY_SECURE");
            } else if (score >= 80) {
                System.out.println("SECURE");
            } else if (score >= 70) {
                System.out.println("VERY_STRONG");
            } else if (score >= 60) {
                System.out.println("STRONG");
            } else if (score >= 50) {
                System.out.println("AVERAGE");
            } else if (score >= 25) {
                System.out.println("WEAK");
            } else {
                System.out.println("VERY_WEAK");
            }
        }

    }

    // 长度
    public static int getLen(String str) {
        int len = str.length();
        if(len <= 4) {
            return 5;
        }else if(len <= 7) {
            return 10;
        }else {
            return 25;
        }
    }

    // 字母
    public static int getChar(String str) {
        int small = 0;
        int large = 0;
        for(int i = 0; i < str.length(); i++) {
            if(str.charAt(i) >= 97 && str.charAt(i) <= 122) {
                small++;
            }
            if(str.charAt(i) >= 65 && str.charAt(i) <= 90) {
                large++;
            }
        }
        if(small > 0 && large > 0) {
            return 20;
        }else if(small > 0) {
            return 10;
        }else if(large > 0) {
            return 10;
        }else{
            return 0;
        }
    }

    // 数字
    public static int getNum(String str) {
        int count = 0;
        for(int i = 0; i < str.length(); i++) {
            if(str.charAt(i)-'0' >= 0 && str.charAt(i)-'0' <= 9) {
                count++;
            }
        }
        if(count == 0) {
            return 0;
        }else if(count == 1) {
            return 10;
        }else {
            return 25;
        }
    }

    // 符号
    public static int getSym(String str) {
        int countChar = 0;
        int count = 0;
        for(int i = 0; i < str.length(); i++) {
            if(!(str.charAt(i) >= 97 && str.charAt(i) <= 122) && !(str.charAt(i) >= 65 && str.charAt(i) <= 90) && !(str.charAt(i)-'0' >= 0 && str.charAt(i)-'0' <= 9)) {
                count++;
            }
        }
        if(count == 0) {
            return 0;
        }else  if(count == 1) {
            return 10;
        }else {
            return 25;
        }
    }
}
